package com.example.rocketstream.temp.stream.processor;

import com.example.rocketstream.temp.entity.Ant;
import com.example.rocketstream.temp.stream.StreamInput;
import com.example.rocketstream.temp.stream.StreamOutput;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @author aliceblue
 * @date 20/2/19 17:51
 */
@Component
@EnableBinding({StreamOutput.class, StreamInput.class})
public class MQReciver {

    @StreamListener(StreamInput.SMS_INPUT)
    public void test(String message){
        System.out.println(message);
    }

    @StreamListener(StreamInput.ANT_INPUT)
    public void objectTest(Ant ant){
        System.out.println(ant.getSize());
    }
}
